package com.hcm.sk.controller;

import com.hcm.sk.pojo.User;
import com.hcm.sk.service.IGoodsService;
import com.hcm.sk.service.IUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @description: GoodsController
 * @date: 2021/1/26 12:58
 * @author: hcm
 * @version: 1.0
 */
@Controller
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    IUserService userService;
    @Autowired
    private IGoodsService goodsService;
    /**
     * 跳转商品列表
     * @return
     */
    @RequestMapping("/toList")
    public String toList(Model model , User user){
        model.addAttribute("user",user);
        model.addAttribute("goodsList",goodsService.findGoodsVo());
        return "goodsList";
    }
}
